package com.shanzmoo.platform.tomerchant.api.web.open;

import com.shanzmoo.base.bean.SHttpResponse;
import com.shanzmoo.core.domain.OssPolicyVO;
import com.shanzmoo.core.manager.base.OssManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * Oss相关操作接口
 * @author Gzhao
 * @date 2020/12/1
 */
@Slf4j
@Api(tags = "B端H5-Oss管理")
@RestController
@RequiredArgsConstructor
public class OssController {

    private final OssManager ossManager;

    @ApiOperation(value = "oss上传签名生成")
    @PostMapping(value = "/api/oss/policy")
    public SHttpResponse<OssPolicyVO> obtainPolicy() {
        return SHttpResponse.ok(ossManager.policy());
    }

}
